/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sasp_messages;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONException;
import org.json.JSONObject;

/**
 *
 * @author mauriello
 */
public class PINGCommand extends SASPCommand {
    public PINGCommand( ) {
        super( );
        this.setType(PING);
    }

    public PINGCommand( int _o, int _d, int _m ) {
        super( _o, _d, _m );
        this.setType(PING);
        this.setCommandBody(new JSONObject());
    }

    public PINGCommand( String _s ) {
        super( _s );
        saspmanager.SASPManagerApp.addLine("PNG - Ping Message Received");
    }

    @Override
    public void updateCommandBody( ) {
        this.setCommandBody(new JSONObject());
    }

    @Override
    public SASPReply execute() {
        saspmanager.SASPManagerApp.addLine("PNG - ACK Reply Generated");
        return new ACKReply(this.getDestinationID(),this.getOriginatorID(),this.getMessageID());
    }
}
